'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const {
      INTEGER,
      DATE,
      STRING,
      TEXT,
    } = Sequelize;
    return await queryInterface.createTable('productevaluate', {
      id: {
        type: INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
        comment: '序号',
      },
      sid: {
        type: INTEGER,
        comment: '所属商品',
      },
      evaluatename: {
        type: STRING,
        comment: '评价用户名',
      },
      evaluatetext: {
        type: TEXT,
        comment: '评价内容',
      },
      evaluateimg: {
        type: TEXT,
        comment: '评价图片',
      },
      createdDate: {
        type: DATE,
        comment: '创建时间',
      },
    });
  },

  down: async queryInterface => {
    return await queryInterface.dropTable('productevaluate');
  },
};
